unit untProcessoPadrao;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, cxIntlBase, cxintl, ExtCtrls,
  cxGridLevel, cxControls, cxGridCustomView, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGrid, cxPC, IBQuery,
  IBCustomDataSet, dxBarDBNav, dxBar, cxClasses, cxPropertiesStore,
  ActnList, ImgList, cxGridCustomPopupMenu, cxGridPopupMenu,
  cxLookAndFeels, ACBrBase, ACBrEnterTab, cxContainer,
  cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue,
  dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinFoggy,
  dxSkinGlassOceans, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
  dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins,
  dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
  dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
  dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinPumpkin, dxSkinSeven,
  dxSkinSharp, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
  dxSkinSummer2008, dxSkinsDefaultPainters, dxSkinValentine,
  dxSkinXmas2008Blue, dxSkinscxPCPainter, dxSkinsdxBarPainter;

type
  TfrmProcessoPadrao = class(TForm)
    ACBrEnterTab1: TACBrEnterTab;
    LookAndFeelController: TcxLookAndFeelController;
    GridPopupMenu: TcxGridPopupMenu;
    cxImageList1: TcxImageList;
    ActionList1: TActionList;
    ActFirst: TAction;
    ActPrior: TAction;
    ActNext: TAction;
    ActLast: TAction;
    ActInsert: TAction;
    ActDelete: TAction;
    ActEdit: TAction;
    ActSave: TAction;
    ActCancel: TAction;
    ActRefresh: TAction;
    ActFilter: TAction;
    ActFechar: TAction;
    ActESC: TAction;
    ActContrair: TAction;
    ActExpandir: TAction;
    ActExportar: TAction;
    ActConfigurar: TAction;
    ActCadLookup: TAction;
    ActImprimir: TAction;
    cxPropertiesStore: TcxPropertiesStore;
    SaveDialog: TSaveDialog;
    dxBarManager: TdxBarManager;
    dxBarManager1Bar1: TdxBar;
    btnInsert: TdxBarButton;
    btnDelete: TdxBarButton;
    btnSalvar: TdxBarButton;
    btnEditar: TdxBarButton;
    btnCancelar: TdxBarButton;
    dxBarDBNavFirst1: TdxBarDBNavButton;
    dxBarDBNavPrior1: TdxBarDBNavButton;
    dxBarDBNavNext1: TdxBarDBNavButton;
    dxBarDBNavLast1: TdxBarDBNavButton;
    dxBarDBNavDelete1: TdxBarDBNavButton;
    dxBarDBNavEdit1: TdxBarDBNavButton;
    dxBarDBNavPost1: TdxBarDBNavButton;
    dxBarDBNavCancel1: TdxBarDBNavButton;
    dxBarDBNavRefresh1: TdxBarDBNavButton;
    dxBarDBNavInsert1: TdxBarDBNavButton;
    btnCustomizar: TdxBarButton;
    btnexportar: TdxBarButton;
    btnContrair: TdxBarButton;
    btnExpandir: TdxBarButton;
    btnImprimir: TdxBarButton;
    dxBarDBNavigator1: TdxBarDBNavigator;
    dsLink: TDataSource;
    dsRegistro: TDataSource;
    dsPesquisa: TDataSource;
    dtEdit: TIBDataSet;
    dtList: TIBQuery;
    pgcCadastro: TcxPageControl;
    tbsLista: TcxTabSheet;
    Grid: TcxGrid;
    GridDBTableView1: TcxGridDBTableView;
    GridLevel1: TcxGridLevel;
    Panel1: TPanel;
    tbsEdita: TcxTabSheet;
    Panel2: TPanel;
    cxIntl1: TcxIntl;
    procedure ActExportarExecute(Sender: TObject);
    procedure ActConfigurarExecute(Sender: TObject);
    procedure ActESCExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmProcessoPadrao: TfrmProcessoPadrao;

implementation

{$R *.dfm}

procedure TfrmProcessoPadrao.ActExportarExecute(Sender: TObject);
begin
   with SaveDialog do
  begin
  {  DefaultExt := 'xls';
    Filter := '*.xls';
   FileName := 'Cadastros de '+TfrmCadPadrao(owner).Caption;
    if Execute then
      ExportGridToExcel(FileName,Grid);}
  end;
end;

procedure TfrmProcessoPadrao.ActConfigurarExecute(Sender: TObject);
begin
  TcxGridTableController(Grid.FocusedView.Controller).Customization := True;
end;

procedure TfrmProcessoPadrao.ActESCExecute(Sender: TObject);
begin
  if (Application.MessageBox('Deseja realmente sair do cadastro?','Aviso',mb_yesno + mb_iconquestion) = id_no) then
      exit;

    close;
end;

end.
